package com.qk.management.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qk.common.PageResult;
import com.qk.domain.operateLog.OperateLogDO;
import com.qk.dto.operateLog.OperateLogDTO;
import com.qk.entity.OperateLog;
import com.qk.management.mapper.OperateLogMapper;
import com.qk.management.service.OperateLogService;
import org.springframework.stereotype.Service;

/**
 * @Author ZgYn
 * @Date 2025/10/17 17:07
 * @Name OperateLogServiceImpl
 */
@Service
public class OperateLogServiceImpl extends ServiceImpl<OperateLogMapper, OperateLog> implements OperateLogService {
    @Override
    public PageResult<OperateLogDO> selectByPage(OperateLogDTO operateLogDTO) {
        Page<OperateLogDO> page = new Page<>(operateLogDTO.getPage(), operateLogDTO.getPageSize());
        Page<OperateLogDO> operateLogList = this.baseMapper.selectByPage(page, operateLogDTO);
        return PageResult.<OperateLogDO>builder()
                .total(Long.valueOf(operateLogList.getTotal()).intValue())
                .rows(operateLogList.getRecords())
                .build();

    }
}
